Search option via attributes
Description
You can search objects by their attributes (e.g. all parts that are black).
Functionality
Almost all data in the ClassiX® system can receive additional information via so-called attributes. For example, an attribute could be assigned to each company, indicating how many employees this company employs. Another one, how many screen workstations there are.
This module is now available, for example, to search for all companies with more than 40 workstations. It allows a combination of an unlimited number of attributes, which searches for suitable objects in the list from which this search was opened.
All attributes to be searched for can be inserted into the list with the "Insert" button. After the insertion the comparison operators (e.g. =, >, present, not present) and the possibly required comparison values can be set here. They are linked with"AND". So if two attributes are inserted in this list, both attributes (as set) must be present on the object in order to obtain a hit in the search.
Example: Search via the list of companies:
Attribute "NUMBER_OF_EMPLOYEES", comparison operator ">=" comparison value "40".
All companies that have the attribute NUMBER_COMPLETEES with a value greater than or equal to 40 are found.
button | Description |
---|---|
Selected attributes... | - |
: Send search query to all open list windows | If this checkbox is set, the entered search query will be sent to all ClassiX list windows currently visible on the screen one after the other, which will then display their search results |
Insert | Call up the attribute selection window to insert an attribute to be searched for. Then the search value and the comparison operator can be set. |
Remove | Remove selected attribute |
Comparison operator | Description |
---|---|
= | same |
!= | unlike |
@ | Object identity (same database address - i.e. not only value comparison) |
> | larger |
>= | greater than or equal to |
< | smaller |
<= | less than or equal to |
available | Checks whether an attribute is present |
not available | Checks whether an attribute is not present |
button | Description |
---|---|
Insert | Call up the selection window of the attributes |
Remove | Remove selected attribute |
OK | Start search for attributes |
Close | The window is closed |
Related topics
Technical documentation
Enquiry about module features
Module name
queryatt.mod
Classes
Security
In addition to restricting access rights via the class and its data fields, the module can be restricted in its use via some of the received messages.
Message | Parameters | Function | Security |
---|---|---|---|
ATTRIBUTE_SELECTED | Collection attribute objects | Attributes were selected | |
CREATE_QUERY_BY_ATTRIBUTES | Recipient of the reply | Call up the input window | |
SLOT_ATTRIBUTE_SELECTED | Collection of preset attribute objects | Attributes were selected | |
CREATE_QUERY_ATTRIBUTES
| Heading for search window and sender widget(TOP) | Attribute search mask is opened |
Message | Parameters | Function | Receiver module |
---|---|---|---|
QUERY_BY_ATTRIBUTE_CREATED | Attribute objects, character string, recipient of the response | Return query string | |
SELECT_SLOT_ATTRIBUTES | NULL or Collection attribute objects | Call up selection window for presettable attributes | Presettable characteristics selection module |
ATTRIBUTE_QUERY_CREATED
| Attribute collection (transient attributes with search parameters TOP) Search string (generated from attributes) ... (Search parameters on the stack of attribute values) | Response message to the search query CREATE_QUERY_ATTRIBUTES |
To implement a search for attributes in a module, the following code template could be used:
Only this code is inserted into the toolbar of the search list:
Button(SearchButton, TOOLTIP("Nach Sachmerkmalswerten suchen", "Search by attributes values"), 0, 0, "Atribute.bmp") [ SELECT : T("Nach Sachmerkmalswerten suchen", "Search by attributes values") Widget SendMsg(CREATE_QUERY_ATTRIBUTES) ATTRIBUTE_QUERY_CREATED : -> searchAttributes DropAll EndTXN BeginTXN(READ) searchAttributes CX_FORWARDER TRUE Widget(SelectWin) G_FindObjectsByAttributes ClearObox(, ListBox) FillObox(, ListBox) Refresh ]
Here, only the class name (here CX_FORWARDER) is replaced by the class name to be searched for or, if necessary, the variable objectClass.
The TRUE controls whether only valid objects are displayed (=TRUE) or also the invalid ones (=FALSE).
The TRUE can also be replaced by the variable "validity", which is used as CX_BIT_PATTERN in most modules. This is also interpreted correctly.
The global function G_FindObjectsByAttributes searches all objects of the transferred class for the selected attributes.
Special rules apply for some classes:
Class | Exception description |
---|---|
CX_PARTNER_CAST (partner functions such as customer, vendor, consultant...) | The own attributes and the attributes of the connected partner (company or person) are included in the search |
CX_ITEM_CAST (partial roles such as sales articles, purchase articles..) | Your own attributes and prices, as well as the attributes of the connected part are included in the search. The customer agreements are also checked for sales articles, and the supplier agreements (including their price chains) for ordered parts. |
CX_BILL_OF_MATERIAL / CX_JOB_SCHEDULE | The own attributes, the attributes of the connected production roll(s) and part, the attributes of the subitems and their quantities of these are included in the search. The items found are output in an extra list. Not all BOM/routing headers are displayed for which only their sub-items were found in the search. It can therefore happen that the list of parts lists / routings is empty, but search results are displayed in the corresponding item window. In the case of conditional items, the individual item variants are of course also checked. |